<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8"%>

<%@page import="com.wzw.tcjh.PageDivision"%>
<%@page import="java.util.List"%>
<%@page import="com.wzw.tcjh.Customer"%>
<%@page import="com.wzw.tcjh.CustomerTools"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<% int pageSize = 10; %>
<head>
<title>汇丰晋信天才儿童的添财计划—天才基因早发现</title>
<link href="css/main.css" media="screen" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.STYLE1 {color: #eb1a11}
-->
</style>
<script type="text/javascript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->
</script>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
</head>
<%
	boolean optSucc = true;
	if(session.getAttribute("user")==null || session.getAttribute("projectCode")==null){
		response.sendRedirect("login.jsp");
		return;
	}
	String[] awardIds = request.getParameterValues("award");
	String projectCode = (String)session.getAttribute("projectCode");
	try{
		if(awardIds!=null)
			CustomerTools.updateCustomerAward(awardIds, true, projectCode);
			CustomerTools.writeAwardCustomerToXml(projectCode,request.getSession().getServletContext().getRealPath("/"));
	}catch(Exception e){
		optSucc = false;
	}
	
	if(optSucc){
%>
<script language="javascript">
<%
	for(int i = 0; awardIds != null && i < awardIds.length; i++){
%>
	parent.document.getElementById('award_<%=awardIds[i]%>').innerHTML='中奖';
<%
	}
%>
	parent.alert('操作成功');
</script>
<% 
	}else{
%>
<script language="javascript">
	parent.alert('操作失败，稍后再试');
</script>
<%
	}
%>